#!/usr/bin/perl

use LWP::UserAgent;
use URI::Escape;
use HTTP::Request::Common qw(POST GET);
use XML::Simple;

use strict;
use warnings;
#use Data::Dumper;

binmode(STDOUT, "utf8");

my $url = 'http://XXX:XXX@api.del.icio.us/v1/posts/recent?';

my $ua = LWP::UserAgent->new();

my $req = GET $url; 
my $res = $ua->request($req);

if ($res->is_success) {
  my $respuesta=XMLin($res->content);
  print XMLout($respuesta, RootName=>'posts');
  #print Dumper($respuesta->{post});
} else {
  die $res->status_line;
}
